public class Test1 {
    public static void main(String[] args) {
        int i,j,p,count = 0;
        for (i = 2; i <= 100; i++){
            p = 1;
            for (j = 2; j <= i-1; j++){
                if(i % j == 0){
                    p = 0;
                    break;
                }
            }
            if(p == 1){
                System.out.println(i);
                count += i;
            }
        }
        System.out.println("总和" + count);
    }
}
